package com.baomidou.mybatisplus.service;

import com.baomidou.mybatisplus.domain.User;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;

@Service
public class UserService extends ServiceImpl<UserMapper, User> {

    @Autowired
    private UserMapper userMapper;

    public void addUser(){
        User user = new User();
        user.setName("ls");
        user.setAge(20);
        userMapper.insert(user);
        System.out.println("ok");
    }

    public void getUsers(){
        userMapper.selectList(null);
        System.out.println("ok");
    }

}
